<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Utils.CliOption</span><span>
</span><span id="line-2"></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Utils.CliOption.html#Option"><span class="hs-identifier">Option</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-3"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.CliOption.html#showOpt"><span class="hs-identifier">showOpt</span></a></span><span>
</span><span id="line-4"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-5"></span><span>
</span><span id="line-6"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Command-line options</span><span>
</span><span id="line-10"></span><span>
</span><span id="line-11"></span><span class="hs-comment">-- | When invoking external tools as part of the compilation pipeline, we</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- pass these a sequence of options on the command-line. Rather than</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- just using a list of Strings, we use a type that allows us to distinguish</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- between filepaths and 'other stuff'. The reason for this is that</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- this type gives us a handle on transforming filenames, and filenames only,</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- to whatever format they're expected to be on a particular platform.</span><span>
</span><span id="line-17"></span><span class="hs-keyword">data</span><span> </span><span id="Option"><span class="annot"><a href="GHC.Utils.CliOption.html#Option"><span class="hs-identifier hs-var">Option</span></a></span></span><span>
</span><span id="line-18"></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="FileOption"><span class="annot"><a href="GHC.Utils.CliOption.html#FileOption"><span class="hs-identifier hs-var">FileOption</span></a></span></span><span> </span><span class="hs-comment">-- an entry that _contains_ filename(s) / filepaths.</span><span>
</span><span id="line-19"></span><span>              </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>  </span><span class="hs-comment">-- a non-filepath prefix that shouldn't be</span><span>
</span><span id="line-20"></span><span>                      </span><span class="hs-comment">-- transformed (e.g., &quot;/out=&quot;)</span><span>
</span><span id="line-21"></span><span>              </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>  </span><span class="hs-comment">-- the filepath/filename portion</span><span>
</span><span id="line-22"></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="Option"><span class="annot"><a href="GHC.Utils.CliOption.html#Option"><span class="hs-identifier hs-var">Option</span></a></span></span><span>     </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-23"></span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span> </span><span id="local-6989586621680776687"><span id="local-6989586621680776694"><span class="annot"><span class="annottext">Option -&gt; Option -&gt; Bool
(Option -&gt; Option -&gt; Bool)
-&gt; (Option -&gt; Option -&gt; Bool) -&gt; Eq Option
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Option -&gt; Option -&gt; Bool
$c/= :: Option -&gt; Option -&gt; Bool
== :: Option -&gt; Option -&gt; Bool
$c== :: Option -&gt; Option -&gt; Bool
</span><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></span></span></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="annot"><a href="GHC.Utils.CliOption.html#showOpt"><span class="hs-identifier hs-type">showOpt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.CliOption.html#Option"><span class="hs-identifier hs-type">Option</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-26"></span><span id="showOpt"><span class="annot"><span class="annottext">showOpt :: Option -&gt; String
</span><a href="GHC.Utils.CliOption.html#showOpt"><span class="hs-identifier hs-var hs-var">showOpt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.CliOption.html#FileOption"><span class="hs-identifier hs-type">FileOption</span></a></span><span> </span><span id="local-6989586621680776684"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680776684"><span class="hs-identifier hs-var">pre</span></a></span></span><span> </span><span id="local-6989586621680776683"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680776683"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680776684"><span class="hs-identifier hs-var">pre</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680776683"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-27"></span><span class="annot"><a href="GHC.Utils.CliOption.html#showOpt"><span class="hs-identifier hs-var">showOpt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Utils.CliOption.html#Option"><span class="hs-identifier hs-type">Option</span></a></span><span> </span><span id="local-6989586621680776682"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680776682"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680776682"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-28"></span></pre></body></html>